var e = require;
var t = module;
var n = exports;
var i =
        (this && this.__awaiter) ||
        function (e, a, s, c) {
            return new (s = s || Promise)(function (n, t) {
                function o(e) {
                    try {
                        r(c.next(e));
                    } catch (e) {
                        t(e);
                    }
                }
                function i(e) {
                    try {
                        r(c.throw(e));
                    } catch (e) {
                        t(e);
                    }
                }
                function r(e) {
                    var t;
                    e.done
                        ? n(e.value)
                        : ((t = e.value) instanceof s
                              ? t
                              : new s(function (e) {
                                    e(t);
                                })
                          ).then(o, i);
                }
                r((c = c.apply(e, a || [])).next());
            });
        },
    r =
        (this && this.__generator) ||
        function (n, o) {
            var i,
                r,
                a,
                s = {
                    label: 0,
                    sent: function () {
                        if (1 & a[0]) throw a[1];
                        return a[1];
                    },
                    trys: [],
                    ops: []
                },
                e = {next: t(0), throw: t(1), return: t(2)};
            return (
                "function" == typeof Symbol &&
                    (e[Symbol.iterator] = function () {
                        return this;
                    }),
                e
            );
            function t(t) {
                return function (e) {
                    return (function (t) {
                        if (i) throw new TypeError("Generator is already executing.");
                        for (; s; )
                            try {
                                if (
                                    ((i = 1),
                                    r &&
                                        (a =
                                            2 & t[0]
                                                ? r.return
                                                : t[0]
                                                ? r.throw || ((a = r.return) && a.call(r), 0)
                                                : r.next) &&
                                        !(a = a.call(r, t[1])).done)
                                )
                                    return a;
                                switch (((r = 0), (t = a ? [2 & t[0], a.value] : t)[0])) {
                                    case 0:
                                    case 1:
                                        a = t;
                                        break;
                                    case 4:
                                        return s.label++, {value: t[1], done: !1};
                                    case 5:
                                        s.label++, (r = t[1]), (t = [0]);
                                        continue;
                                    case 7:
                                        (t = s.ops.pop()), s.trys.pop();
                                        continue;
                                    default:
                                        if (
                                            !(a = 0 < (a = s.trys).length && a[a.length - 1]) &&
                                            (6 === t[0] || 2 === t[0])
                                        ) {
                                            s = 0;
                                            continue;
                                        }
                                        if (3 === t[0] && (!a || (t[1] > a[0] && t[1] < a[3]))) {
                                            s.label = t[1];
                                            break;
                                        }
                                        if (6 === t[0] && s.label < a[1]) {
                                            (s.label = a[1]), (a = t);
                                            break;
                                        }
                                        if (a && s.label < a[2]) {
                                            (s.label = a[2]), s.ops.push(t);
                                            break;
                                        }
                                        a[2] && s.ops.pop(), s.trys.pop();
                                        continue;
                                }
                                t = o.call(n, s);
                            } catch (e) {
                                (t = [6, e]), (r = 0);
                            } finally {
                                i = a = 0;
                            }
                        if (5 & t[0]) throw t[1];
                        return {value: t[0] ? t[1] : void 0, done: !0};
                    })([t, e]);
                };
            }
        },
    a =
        (this && this.__spreadArrays) ||
        function () {
            for (var e = 0, t = 0, n = arguments.length; t < n; t++) e += arguments[t].length;
            for (var o = Array(e), i = 0, t = 0; t < n; t++)
                for (var r = arguments[t], a = 0, s = r.length; a < s; a++, i++) o[i] = r[a];
            return o;
        };
Object.defineProperty(n, "__esModule", {value: !0}), (n.WebPlatform = void 0);
var o = e("user-data"),
    s = e("platform-const"),
    c = e("events"),
    e =
        ((l.prototype.string = function () {
            return s.PlatformCode.Web;
        }),
        (l.prototype.initSDK = function () {
			return;
            cc.log("WebPlatform does not support sdk");
            var e = new URLSearchParams(location.search),
                n = {};
            e.forEach(function (e, t) {
                n[t] = e;
            }),
                o.userData.syncLaunchOption({query: n}),
                this.initByteDanceListener();
        }),
        (l.prototype.initByteDanceListener = function () {
            cc.game.on(cc.game.EVENT_HIDE, function () {
                c.platformEvent.emit({onHide: !0});
            }),
                cc.game.on(cc.game.EVENT_SHOW, function () {
                    c.platformEvent.emit({onShow: !0, isSharing: this.isSharing});
                });
        }),
        (l.prototype.isSwitchedInitd = function () {
            return !0;
        }),
        (l.prototype.login = function () {
            return i(this, void 0, Promise, function () {
                return r(this, function () {
                    return [2, null];
                });
            });
        }),
        (l.prototype.getStorage = function (e) {
            return JSON.parse(cc.sys.localStorage.getItem(e));
        }),
        (l.prototype.setStorage = function (e, t) {
            cc.sys.localStorage.setItem(e, JSON.stringify(t));
        }),
        (l.prototype.clearStorage = function () {
            // cc.sys.localStorage.clear();
        }),
        (l.prototype.removeStorage = function (e) {
            cc.sys.localStorage.removeItem(e);
        }),
        (l.prototype.trackLogin = function () {
            cc.log("WebPlatform does not support tga");
        }),
        (l.prototype.trackUserSet = function () {
            cc.log("WebPlatform does not support tga");
        }),
        (l.prototype.trackUserSetOnce = function () {
            cc.log("WebPlatform does not support tga");
        }),
        (l.prototype.trackEvent = function (e, t) {
            cc.log("打点...", e, t);
        }),
        (l.prototype.getSeq = function () {
            return {
                type: Math.random() < 0.5 ? s.STDSeqType.VIDEO : s.STDSeqType.SHARE,
                modelId: "",
                shareGuid: "",
                forceResult: ""
            };
        }),
        (l.prototype.consumeSeq = function () {
            return i(this, void 0, Promise, function () {
                return r(this, function () {
                    return [2];
                });
            });
        }),
        (l.prototype.doWatchAD = function () {
            return i(this, void 0, Promise, function () {
                return r(this, function () {
                    return [2];
                });
            });
        }),
        (l.prototype.doShare = function () {
            return i(this, void 0, Promise, function () {
                return r(this, function () {
                    return [2];
                });
            });
        }),
        (l.prototype.getSystemData = function () {
            return s.DefaultSystemInfo;
        }),
        (l.prototype.getSwitches = function () {
            return s.DefaultSDKSwitch;
        }),
        (l.prototype.vibrate = function () {}),
        (l.prototype.preloadVideo = function () {
            return !0;
        }),
        (l.prototype.showModal = function () {
            return i(this, void 0, Promise, function () {
                return r(this, function () {
                    return [2, !0];
                });
            });
        }),
        (l.prototype.refreshGame = function () {
            location.reload();
        }),
        (l.prototype.showLoading = function () {}),
        (l.prototype.hideLoading = function () {}),
        (l.prototype.log = function (e) {
            for (var t = [], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
            console.log.apply(console, a([s.LogTag, e], t));
        }),
        (l.prototype.getMenuBounding = function () {
            return null == this.menuBounding && (this.menuBounding = new cc.Rect(650, 0, 100, 50)), this.menuBounding;
        }),
        (l.prototype.createShareImage = function () {
            return i(this, void 0, Promise, function () {
                return r(this, function () {
                    return [2, ""];
                });
            });
        }),
        (l.prototype.preloadInterstitialAD = function (e) {
            console.log("preload inter ad", e);
        }),
        (l.prototype.showInterstitialAD = function (e) {
            return i(this, void 0, Promise, function () {
                return r(this, function () {
                    return console.log("show inter ad", e.adUnit), [2];
                });
            });
        }),
        (l.prototype.canShowBanner = function () {
            return !1;
        }),
        (l.prototype.getBannerSize = function () {
            return new cc.Size(0, 0);
        }),
        (l.prototype.showBanner = function () {
            cc.log("WebPlatform does not support banner");
        }),
        (l.prototype.hideBanner = function () {
            cc.log("WebPlatform does not support banner");
        }),
        (l.prototype.getSubscribeCnt = function () {
            return i(this, void 0, Promise, function () {
                return r(this, function () {
                    return [2, 0];
                });
            });
        }),
        (l.prototype.subscribe = function (n) {
            for (var o = [], e = 1; e < arguments.length; e++) o[e - 1] = arguments[e];
            return i(this, void 0, Promise, function () {
                var e, t;
                return r(this, function () {
                    return (
                        (e = a([n], o)),
                        (t = {}),
                        e.forEach(function (e) {
                            t[e] = !0;
                        }),
                        [2, t]
                    );
                });
            });
        }),
        (l.prototype.startVideoRecord = function () {}),
        (l.prototype.pauseVideoRecord = function () {}),
        (l.prototype.resumeVideoRecord = function () {}),
        (l.prototype.stopVideoRecord = function () {}),
        (l.prototype.hasVideoRecord = function () {
            return !1;
        }),
        (l.prototype.shareVideoRecord = function () {}),
        (l.prototype.uploadAdEvent = function () {}),
        (l.prototype.uploadAdEvent_Addict = function () {}),
        (l.prototype.addShortcut = function () {}),
        l);
function l() {}
n.WebPlatform = e;
